function UnitTests:testDramaManagerPruning()

	-- test : remove all keys that are not collasped and that are related to doors that collasped as unlocked and open
	
	local stage =
	{
		Rooms =
		{
			Room1 =
			{			
			},
			
			Room2 =
			{	
			},
			
			Room3 =
			{	
			},
			
			Room4 =			-- we add an extra room to avoid key collapsing by indirect reduction
			{	
			},								
		},
		
		Doors =
		{
			{
				Rooms = 
				{
					"Room1",
					"Room2"
				},
				
				ClosedAndLocked = true		
			},
			
			{
				Rooms = 
				{
					"Room2",
					"Room3"
				},
				
				ClosedAndLocked = true		
			},

			{
				Rooms = 
				{
					"Room3",
					"Room4"
				},
			},
		}		
	}
	
	local cast =
	{
		Player =
		{
			initialLocation = "Room1"
		},
	}
	
	local game = Game:new(stage, cast)
	
	local room1 = gField.entityTypes.Location.Room1
	local room2 = gField.entityTypes.Location.Room2
	local room3 = gField.entityTypes.Location.Room3
	local room4 = gField.entityTypes.Location.Room4
	local key1 = gField.entityTypes.Key["Room1<->Room2"]
	local key2 = gField.entityTypes.Key["Room2<->Room3"]
			
	gRandom:addContextualBias({"Door", "Room1<->Room2", "EnablingSteps"}, Door.OpenedStep)		-- open doors to allow key pruning
	gRandom:addContextualBias({"Door", "Room2<->Room3", "EnablingSteps"}, Door.OpenedStep)
	gRandom:addContextualBias({"Key", "Room1<->Room2", "CurrentContainer"}, room3)		-- put key1 in room3
	gRandom:addContextualBias({"Key", "Room2<->Room3", "CurrentContainer"}, room2)		-- put key2 in room2
	
	gGame:start()
	
	assert(not key1:isPropertyCollasped("CurrentContainer"))		-- key1 is not collapsed because it is in room3 that is not yet observed					
	assert(not gField.entityTypes.Key["Room1<->Room2"])		-- key1 must have disapeared from the field because it's door is now know as open and key1 is not yet collapsed
	assert(gField.entityTypes.Key["Room2<->Room3"])			-- key2 must still be there because door2 state is not yet know
	
	gPlayer.body:execute("moveTo", room2)
	gGame:onBeat()
	
	assert(key2:isPropertyCollasped("CurrentContainer"))						
	assert(key2:getCollapsedProperty("CurrentContainer") == room2)	
	assert(not gField.entityTypes.Key["Room2<->Room3"])		-- key2 must have dispareared because it's door is now observed. The difference with key1 is that key2 is in the same room as his door
end